//
//  CustomProductCollectionViewCell.m
//  忘不了
//
//  Created by rimi on 16/7/11.
//  Copyright © 2016年 handuan. All rights reserved.
//

#import "CustomProductCollectionViewCell.h"
#import "SDAutoLayout.h"
@implementation CustomProductCollectionViewCell
- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self initializeUserInterface];
    }
    return self;
}
- (void)initializeUserInterface{
    self.name = [UIButton buttonWithType:UIButtonTypeCustom];
    [self.name addTarget:self action:@selector(buttonPressent:) forControlEvents:UIControlEventTouchUpInside];
    self.name.layer.masksToBounds = YES;
    self.name.layer.cornerRadius = 15;
    [self.contentView addSubview:self.name];
    self.name.sd_layout
    .topSpaceToView(self.contentView,0)
    .bottomSpaceToView(self.contentView,0)
    .leftSpaceToView(self.contentView,0)
    .rightSpaceToView(self.contentView,0);
    
    
    //选中的球
//    self.selectedView = [[UIView alloc]init];
////    self.selectedView.bounds = CGRectMake(0, 0, 20, 20);
//    self.selectedView.layer.masksToBounds = YES;
//    self.selectedView.backgroundColor = [UIColor blueColor];
//    self.selectedView.layer.cornerRadius = 10;
//    [self.contentView addSubview:self.selectedView];
//    self.selectedView.sd_layout
//    .topSpaceToView(self.contentView,0)
//    .leftSpaceToView(self.name,20);
}
- (void)buttonPressent:(UIButton *)sender{
    sender.selected = NO;
    if (self.delegate && [self.delegate respondsToSelector:@selector(customProductDelegate:)]) {
        [self.delegate customProductDelegate:self];
    }
}
@end
